package com.cj.mobile.iabp.mvp.model.entity;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * @ProjectName: NewRecyclingAndroid
 * @Package: com.zqw.mobile.recycling.model
 * @ClassName: BatchDeliveryMode
 * @Description: 批量型号
 * @Author: WLY
 * @CreateDate: 2024/1/5 16:27
 */
public class BatchDeliveryMode implements Parcelable {
    public BatchDeliveryMode() {
    }

    public BatchDeliveryMode(String productName, double weight, double price) {
        this.productName = productName;
        this.weight = weight;
        this.price = price;
    }

    public BatchDeliveryMode(String catId, String catName,String productId, String productName, double weight, double signWeight, double price) {
        this.catId = catId;
        this.catName = catName;
        this.productId = productId;
        this.productName = productName;
        this.weight = weight;
        this.signWeight = signWeight;
        this.price = price;
    }

    public BatchDeliveryMode(String catId, String catName, String productId, String productName, double weight, double price) {
        this.catId = catId;
        this.catName = catName;
        this.productId = productId;
        this.productName = productName;
        this.weight = weight;
        this.price = price;
    }

    public BatchDeliveryMode(String productName, double weight, double signWeight, double price) {
        this.productName = productName;
        this.weight = weight;
        this.signWeight = signWeight;
        this.price = price;
    }

    // 品类id
    private String catId;
    // 品类名称
    private String catName;
    // 回收单号
    private String orderNo;
    // 商品id
    private String productId;
    // 商品名称
    private String productName;
    // 重量
    private double weight;
    // 提交时用到的重量
    private double signWeight;
    // 单价
    private double price;
    // 单位
    private String unit;

    // 是否初始化
    private boolean isInit;
    // 总重量 ，本地使用：用于重新计算 库存 字段。
    private double totalWeight;
    // 单品成本
    private double amount;

    public String getCatId() {
        return catId;
    }

    public void setCatId(String catId) {
        this.catId = catId;
    }

    public String getCatName() {
        return catName;
    }

    public void setCatName(String catName) {
        this.catName = catName;
    }

    public String getOrderNo() {
        return orderNo;
    }

    public void setOrderNo(String orderNo) {
        this.orderNo = orderNo;
    }

    public String getProductId() {
        return productId;
    }

    public void setProductId(String productId) {
        this.productId = productId;
    }

    public String getProductName() {
        return productName;
    }

    public void setProductName(String productName) {
        this.productName = productName;
    }

    public double getWeight() {
        return weight;
    }

    public void setWeight(double weight) {
        this.weight = weight;
    }

    public double getSignWeight() {
        return signWeight;
    }

    public void setSignWeight(double signWeight) {
        this.signWeight = signWeight;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public String getUnit() {
        return unit;
    }

    public void setUnit(String unit) {
        this.unit = unit;
    }

    public boolean isInit() {
        return isInit;
    }

    public void setInit(boolean init) {
        isInit = init;
    }

    public double getTotalWeight() {
        return totalWeight;
    }

    public void setTotalWeight(double totalWeight) {
        this.totalWeight = totalWeight;
    }

    public double getAmount() {
        return amount;
    }

    public void setAmount(double amount) {
        this.amount = amount;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.catId);
        dest.writeString(this.catName);
        dest.writeString(this.orderNo);
        dest.writeString(this.productId);
        dest.writeString(this.productName);
        dest.writeDouble(this.weight);
        dest.writeDouble(this.signWeight);
        dest.writeDouble(this.price);
        dest.writeString(this.unit);
        dest.writeByte(this.isInit ? (byte) 1 : (byte) 0);
        dest.writeDouble(this.totalWeight);
        dest.writeDouble(this.amount);
    }

    public void readFromParcel(Parcel source) {
        this.catId = source.readString();
        this.catName = source.readString();
        this.orderNo = source.readString();
        this.productId = source.readString();
        this.productName = source.readString();
        this.weight = source.readDouble();
        this.signWeight = source.readDouble();
        this.price = source.readDouble();
        this.unit = source.readString();
        this.isInit = source.readByte() != 0;
        this.totalWeight = source.readDouble();
        this.amount = source.readDouble();
    }

    protected BatchDeliveryMode(Parcel in) {
        this.catId = in.readString();
        this.catName = in.readString();
        this.orderNo = in.readString();
        this.productId = in.readString();
        this.productName = in.readString();
        this.weight = in.readDouble();
        this.signWeight = in.readDouble();
        this.price = in.readDouble();
        this.unit = in.readString();
        this.isInit = in.readByte() != 0;
        this.totalWeight = in.readDouble();
        this.amount = in.readDouble();
    }

    public static final Creator<BatchDeliveryMode> CREATOR = new Creator<BatchDeliveryMode>() {
        @Override
        public BatchDeliveryMode createFromParcel(Parcel source) {
            return new BatchDeliveryMode(source);
        }

        @Override
        public BatchDeliveryMode[] newArray(int size) {
            return new BatchDeliveryMode[size];
        }
    };
}
